<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/head/common/include/page.jsp"%>
<jsp:useBean id="pojo" class="com.wang.users.pojo.AUsers"/>
<c:set value="${requestScope.usersResponse.data.one }" var="one"/>
<c:set value="${requestScope.classResponse.data.list }" var="list"/>
<!DOCTYPE html>
<html lang="zh-CN">
	<head>
		<title>修改个人信息 - 体能测试系统</title>
		<%@ include file="/head/common/include/title.jsp"%>
	    <link rel="stylesheet" href="${rootPath }/head/common/resource/bootstrapvalidator/css/form-validation.css" rel="stylesheet">
	  	<script type="text/javascript" src="${rootPath }/head/common/resource/bootstrapvalidator/js/form-validation.js"></script>
	  	
	  	<script language="javascript" type="text/javascript" src="${rootPath }/common/resource/My97DatePicker/WdatePicker.js"></script>
	  	<script type="text/javascript">
	  		$(function()
			{
			  	$("#form").FormValidation({
		  			fields:
	  				{
		  				phone:
	  					{
		  					validators: {
		  	                    notEmpty: {
		  	                        message: '手机号不能为空'
		  	                    },
		  	                    stringLength: {
		  	                        min: 11,
		  	                        max:11,
		  	                        message: '手机号的长度为在11位'
		  	                    },
		  	                    regexp: {
		  	                        regexp: /^[\d]{11}$/i,
		  	                        message: '手机号不符合规则'
		  	                    }
		  	                }
	  					},
	  					grade:
	  					{
		  					validators: {
		  	                    notEmpty: {
		  	                        message: '年级不能为空'
		  	                    },
		  	                    regexp: {
		  	                        regexp: /^[\d]+$/i,
		  	                        message: '年级不符合规则'
		  	                    }
		  	                }
	  					},
	  					age:
	  					{
		  					validators: {
		  	                    notEmpty: {
		  	                        message: '年龄不能为空'
		  	                    },
		  	                    regexp: {
		  	                        regexp: /^[\d]+$/i,
		  	                        message: '年龄不符合规则'
		  	                    }
		  	                }
	  					},
	  				}
				});
			  	
			});
	  	</script>
	</head>
	<body>
		<%@ include file="/head/common/include/header.jsp"%>
		<!-- 网页的主体 -->
		<div class="container">
			<div class="col-md-8 col-sm-10">
				<form id="form" method="post" class="form-horizontal" action="${rootPath }/head/users/usersUpdateSubmit">
					<input type="hidden" name="operType" value="${param.operType }">
					<h2
						class="col-sm-10 col-sm-offset-1 form-signin-heading text-center">修改个人信息</h2>
					<div class="form-group row">
						<label for="inputPassword" class="col-sm-3 control-label">邮箱</label>
						<div class="col-sm-8">
							<input type="text" name="email" id="email" value="${one.email }"
								class="form-control" placeholder="邮箱" />
						</div>
					</div>
					<div class="form-group row">
						<label for="email" class="col-sm-3 control-label">真实姓名</label>
						<div class="col-sm-8">
							<input type="text" name="trueName" id="trueName" value="${one.trueName }"
								class="form-control" placeholder="真实姓名" />
						</div>
					</div>
					<div class="form-group row">
						<label for="email" class="col-sm-3 control-label">手机</label>
						<div class="col-sm-8">
							<input type="text" name="phone" id="phone" value="${one.phone }"
								class="form-control" placeholder="手机" />
						</div>
					</div>
					<div class="form-group row">
						<label for="email" class="col-sm-3 control-label">qq</label>
						<div class="col-sm-8">
							<input type="text" name="qq" id="qq" value="${one.qq }"
								class="form-control" placeholder="qq" />
						</div>
					</div>
					<div class="form-group row">
						<label for="email" class="col-sm-3 control-label">身份证</label>
						<div class="col-sm-8">
							<input type="text" name="idnumber" id="idnumber" value="${one.idnumber }"
								class="form-control" placeholder="idnumber" />
						</div>
					</div>
					<div class="form-group row">
						<label for="inputPassword" class="col-sm-3 control-label">生日</label>
						<div class="col-sm-8">
							<c:choose>
								<c:when test="${one.birthday != null}">
									<c:set value="${one.birthday }" var="birthday"/>
								</c:when>
								<c:otherwise>
									<fmt:formatDate value="${sys_now }" pattern="yyyy-MM-dd" var="birthday"/>
								</c:otherwise>
							</c:choose>
							<input type="text" name="birthdayStr" id="birthdayStr" value="${birthday }" readonly="readonly"
								onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})"
								class="form-control" placeholder="生日" />
						</div>
					</div>
					<div class="form-group row">
						<label for="email" class="col-sm-3 control-label">年级</label>
						<div class="col-sm-8">
							<input type="text" name="grade" id="grade" value="${one.grade }"
								class="form-control" placeholder="grade" />
						</div>
					</div>
					<div class="form-group row">
						<label for="email" class="col-sm-3 control-label">学号</label>
						<div class="col-sm-8">
							<input type="text" name="numb" id="numb" value="${one.numb }"
								class="form-control" placeholder="numb" />
						</div>
					</div>
					<div class="form-group row">
						<label for="email" class="col-sm-3 control-label">年龄</label>
						<div class="col-sm-8">
							<input type="text" name="age" id="age" value="${one.age }"
								class="form-control" placeholder="age" />
						</div>
					</div>
					<div class="form-group row">
						<label for="inputPassword" class="col-sm-3 control-label">性别</label>
						<div class="col-sm-8">
							<c:forEach items="${pojo.enumsMap }" var="me" varStatus="stat">
								<c:if test="${fn:startsWith(me.key,'SEX')}">
									<!-- 拆分,按照-拆分,取最后一个 -->
									<c:set value="${fn:split(me.key, '-')}" var="keys"/>
									<div class="form-check form-check-inline">
										<label class="form-check-label" for="${me.key}">
											<input type="radio" name="sex" id="${me.key}" value="${keys[1] }" 
												class="form-check-input" placeholder="生日" 
												${one.sex == keys[1] ? 'checked' : '' }
											/>
										    ${me.value }
										</label>
									</div>
								</c:if>
							</c:forEach>
						</div>
					</div>
					<div class="form-group">
						<div class="col-sm-8 col-sm-offset-2">
							<button class="btn btn-md btn-primary" type="submit">提交</button>
						</div>
					</div>
				</form>
			</div>
		</div>
		<%@ include file="/head/common/include/footer.jsp"%>
	</body>
</html>